#include "public_apis.h"

static uint32_t public_sys_tick = 0;
static public_task_start_cb_t public_task_start_cb = NULL;

void public_sys_tick_update(uint8_t ms)
{
    public_sys_tick += ms;
}

uint32_t public_sys_tick_get(void)
{
    return public_sys_tick;
}

void public_sys_tick_clear(void)
{
    public_sys_tick = 0;
}

void public_task_register_cb(public_task_start_cb_t cb)
{
    public_task_start_cb = cb;
}


void public_task_start(public_task_cb_t cb, void *arg, uint32_t period)
{
    if (public_task_start_cb != NULL) {
        public_task_start_cb(cb, arg, period);
    }
}
